package com.lktx.auto;

import com.microsoft.playwright.*;
import com.microsoft.playwright.options.Cookie;
import com.microsoft.playwright.options.LoadState;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

public class Main {
    public static void main(String[] args) throws Exception {
        try (Playwright playwright = Playwright.create()) {
            BrowserType browserType = playwright.chromium();
            BrowserType.LaunchPersistentContextOptions launchOptions = new BrowserType.LaunchPersistentContextOptions().setHeadless(false);
            String contextDir = Paths.get("").toAbsolutePath()+ File.separator+"cache";
            BrowserContext context = browserType.launchPersistentContext(Path.of(contextDir), launchOptions);
            Page page = context.newPage();
            page.navigate("https://rd6.zhaopin.com/");
            page.waitForTimeout(10050000);
            context.close();
        }
    }
}